<link rel="stylesheet" href="/css/swiper-4.5.3/dist/css/swiper.min.css">
<script src="/css/swiper-4.5.3/dist/js/swiper.min.js"></script>
<div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide"><img src="/images/pc/前端图.png" alt=""></div>
        <div class="swiper-slide"><img src="/images/pc/图层10.png" alt=""></div>
    </div>
    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>

    <!-- 如果需要导航按钮 -->
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>
</div>

<script src="/js/jquery-3.6.0.min.js"></script>
<script>
    let mySwiper = new Swiper('.swiper-container', {
        direction: 'horizontal', // 垂直切换选项
        loop: true, // 循环模式选项

        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },

        // 如果需要前进后退按钮
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
        autoplay: {
            pauseOnMouseEnter: true,
        },
    })
    mySwiper.el.onmouseover = function() {
        mySwiper.autoplay.stop();
    }
    mySwiper.el.onmouseout = function() {
        mySwiper.autoplay.start();
    }
    $(".swiper-container").mouseover(()=>{
        $(".swiper-button-prev").show()
        $(".swiper-button-next").show()
    })
    $(".swiper-container").mouseleave(()=>{
        $(".swiper-button-prev").hide()
        $(".swiper-button-next").hide()
    })
</script>